<template>
  <div class="app-container">
    <transition name="el-zoom-in-center">
      <rule-list v-if="options.showList" @showCard="showCard"></rule-list>
    </transition>
    <transition name="el-zoom-in-top">
      <rule-add v-if="options.showAdd" :data="options.data" @showCard="showCard"></rule-add>
    </transition>
  </div>
</template>
<script>
  import RuleList from './RuleList'
  import RuleAdd from './RuleAdd'

  export default {
    name: 'DataApi',
    components: { RuleList, RuleAdd },
    data () {
      return {
        options: {
          data: {},
          showList: true,
          showAdd: false,
          showEdit: false,
          showDetail: false,
          showExample: false
        }
      }
    },
    methods: {
      showCard (data) {
        Object.assign(this.options, data)
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>
